<?php
include('/var/www/html/new/d/module/api/function.class.php');
$ac='16ucom';
$pw='c33367701511b4f6020ec61ded352059';
$inSide= new SoapClient(null,array("location" => "http://localhost/open/openService/pft_insideMX.php","uri" => "www.16u.com?ac_16u=$ac|pw_16u=$pw|auth_16u=true"));

$PFT_infunction = new AllFunction();

if (!class_exists("go_sql")){
	include("/var/www/html/new/conf/le.je");
	$le=new go_sql();
	$le->connect();
}

$order = $_REQUEST['order_id'];
// $order = 'pft144228863813154835';
$selorder = "select pftOrder from all_api_order where coopB=2 and oStatus= 0 and tempOrder='$order' limit 1";
$GLOBALS['le']->query($selorder);
if($GLOBALS['le']->fetch_assoc()){
	$pftOrder = $GLOBALS['le']->f('pftOrder');

	$pft_order_xml = $PFT_infunction->Select_PFTorder($pftOrder);

	$UUtnum = (string)$pft_order_xml->Rec->UUtnum;
	$UUtotalmoney =(int)$pft_order_xml->Rec->UUtotalmoney/100; //总价
	$UUaids=(string)$pft_order_xml->Rec->UUaids;
	if($UUaids == 0){  //供应商
		$UUaid = (string)$pft_order_xml->Rec->UUaid;
	}else{
		$UUaidss= explode(',',$UUaids);
		$UUaid = $UUaidss[0];
	}
	$UUpaystatus = (int)$pft_order_xml->Rec->UUpaystatus; //支付状态
	$UUstatus = (int)$pft_order_xml->Rec->UUstatus; //订单状态

	if($UUaid == 4274 && $UUstatus == 0 && $UUpaystatus == 1){
		$response = array(
			'is_success'	=> "true",
			'pay_amount' 	=> $UUtotalmoney,
			'pay_currency'	=> 'CNY',
			'remark'		=> '支付成功',
			'err_code'		=> 0 ,
			'err_msg'		=> '支付成功'
			
		);
	}
	else{
		$response = array(
			'is_success'	=> "false",
			'pay_amount' 	=> '0.00',
			'pay_currency'	=> 'CNY',
			'remark'		=> '没有支付',
			'err_code'		=> -1,
			'err_msg'		=> '订单不属于携程分销订单或者订单状态出错'
			
		);
	}
}

$response_json  = json_encode($response);
echo $response_json;

$PFT_infunction->logfile('2|'.json_encode($_REQUEST).'|'.$response_json,'orderPayNote');
?>